package org.koyi.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class BirrAppDataBase extends SQLiteOpenHelper{
	
	private String sqlCreateTableBares = "CREATE TABLE IF NOT EXISTS BARES( " +
            									"_id                   INTEGER NOT NULL, " +
            									"BAR_NOMBRE            TEXT NOT NULL, " +
            									"PRIMARY KEY( _id )) ";
	
	public BirrAppDataBase(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		 db.execSQL(sqlCreateTableBares);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS BARES ");
        onCreate(db);
	}

}
